<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>助理信息</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
 <link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="css/matrix-style.css" />
<link rel="stylesheet" href="css/matrix-media.css" />
<link href="font-awesome/css/font-awesome.css" rel="stylesheet" />
<link href='http://fonts.useso.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<style>
 .content-header{
  font-size:16px;
  background-color:#fff;
 }
 .content-header table{
  font-weight:bolder;
  margin-left:30px;
 }
 .content-header .header-number{
  margin-left:10px;
 }
  img{
   width:150px;
   height:150px;
  }
  option{
   text-align:center;
  }

</style>
</head>
<body>

<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">Matrix Admin</a></h1>
</div>
<!--close-Header-part--> 

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span class="text">Welcome User</span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i> My Profile</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> My Tasks</a></li>
        <li class="divider"></li>
        <li><a href="login.html"><i class="icon-key"></i> Log Out</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">Messages</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> new message</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> inbox</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> outbox</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> trash</a></li>
      </ul>
    </li>
    <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">Settings</span></a></li>
    <li class=""><a title="" href="login.html"><i class="icon icon-share-alt"></i> <span class="text">Logout</span></a></li>
  </ul>
</div>
<!--sidebar-menu-->

<div id="sidebar" ><a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard2</a>
  <ul>
   <li  ><a  href="<%=request.getContextPath()%>/dashboard"><i class="icon icon-home"></i> <span>Dashboard控制面板</span></a> </li>
    <li> <a href="<%=request.getContextPath()%>/study?method=page"><i class="icon icon-signal"></i> <span>Study news留学信息</span></a> </li>
    <li> <a href="<%=request.getContextPath()%>/travel?method=page"><i class="icon icon-inbox"></i> <span>Travel New旅游信息</span></a> </li>
    <li><a href="<%=request.getContextPath()%>/news?method=page"><i class="icon icon-th"></i> <span>Recent News近期新闻</span></a></li>
    <li><a href="<%=request.getContextPath()%>/member?method=page"><i class="icon icon-fullscreen"></i> <span>Members centre会员中心</span></a></li>
    <li class="active"><a href="<%=request.getContextPath() %>/assist?method=page"><i class="icon icon-th-list"></i> <span>助理管理</span></a>
    </li>
  </ul>
</div>
<div id="content">
  <div class="content-title">
       <button type="submit" onclick="document.location.href='<%=request.getContextPath() %>/assist?method=page'" class="btn" id="toprevious"><i class="icon-step-backward"></i>返回上一级</button>
  </div>
      <div class="span4">
        <div class="widget-box">
	        <div class="widget-title"> <span class="icon"> <i class="icon-briefcase"></i> </span>
	            <h5 >详细信息</h5>
	        </div> 
            <div class="widget-content">
                <table class="table table-bordered table-striped">
                  <tbody>
                    <tr>
                    <tr>
                      <td> ID:</td>
                      <td><strong>${requestScope.assist.id }</strong></td>
                    </tr>
                    <tr>
                      <td>姓名</td>
                      <td><strong>${requestScope.assist.name }</strong></td>
                    </tr>
                    <tr>
                      <td>所属部门</td>
                      <td><strong>${requestScope.assist.department }</strong></td>
                    </tr>
                    <tr>
                    <td class="width30">联系电话</td>
                    <td class="width70">${requestScope.assist.phone }</td>
                    </tr>
                    <tr>
                     <td>邮箱</td>
                     <td>${requestScope.assist.email }</td>
                    </tr>
                    <tr>
                     <td>微信id</td>
                     <td>
                       <div>${requestScope.assist.wxId }</div>
                       <hr/>
                       <img src="${requestScope.assist.code }"  />
                     </td>
                    </tr>
                    </tbody>
                </table>
              </div>
            </div>
           </div>
        <div class="span7">
         <div class="widget-box">
          <div class="widget-title">
           <h5>分配用户</h5>
          </div>
          <div class="widget-content">
          <form name="form1" method="post" action="<%=request.getContextPath() %>/assist?method=dispatch&id=${requestScope.assist.id }">
			<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
			  <tr>
			    <td width="200"><table width="200" border="0" cellpadding="1" cellspacing="1" bgcolor="#CAFAFC">
			      <tr>
			        <td height="25" background="wp-content/uploads/2012/05/79760-772704496-8.gif" bgcolor="#FFFFFF">　　　请选择：</td>
			      </tr>
			      <tr>
			        <td align="center" bgcolor="#FFFFFF"><select name="sel_place1" size="6" multiple id="sel_place1" style="width:200px " >
			          <optgroup label="已分配" >
			           	 <c:forEach var="user" items="${requestScope.listassign}">
			           	  <option value=${user.uid}>${user.uid}</option>		
			           	 </c:forEach>
			          </optgroup>	
  			          <optgroup label="还未分配" >
			           	<c:forEach var="user" items="${requestScope.noassign}">
			           	  <option value=${user.uid}>${user.uid}</option>		
			           	 </c:forEach>
  			          </optgroup>		          	
			        </select></td>
			      </tr>
			    </table></td>
			    <td width="100" align="center" valign="bottom"><input name="sure1" type="button" id="sure1"
			  onClick="allsel(document.form1.sel_place2,document.form1.sel_place1);" value="<<">
			  <input name="sure2" type="button" id="sure2"
			  onClick="allsel(document.form1.sel_place1,document.form1.sel_place2);" value=">>" align="center" height="2"></td>
			    <td width="200"><table width="200" border="0" cellpadding="1" cellspacing="1" bgcolor="#CAFAFC">
			      <tr>
			        <td height="25" background="wp-content/uploads/2012/05/79760-772704496-8.gif" bgcolor="#FFFFFF">　　　请选择：</td>
			      </tr>
			      <tr>
			        <td align="center" bgcolor="#FFFFFF"><select name="sel_place2" size="6" multiple id="sel_place2" style="width:200px ">
			            </select></td>
			      </tr>
			    </table></td>
			  </tr>
			</table>
			<input type="submit" class="btn btn-primary" id="dispatch" onclick="return check()" value="分配">
			</form>
		<!-- modal框 -->
     </div>
    </div>
         <div class="widget-box">
          <div class="widget-title">
           <h5>本助理管理的用户有：</h5>
          </div>
          <div class="widget-content">
          <table class="table table-bordered ">
           <tr>
            <th>用户id</th>
            <th>用户电话</th>
           </tr>
           <c:forEach var="user" items="${requestScope.hasUser}">
           <tr>
            <td>${user.uid }</td>
            <td>${user.phone }</td>
           </tr>
           </c:forEach>
          </table>
          </div>
          </div>
   </div>
</div>
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2016 &copy; <a href="http://themedesigner.in/">guangzhoushuntian information technology</a> </div>
</div>
<!--end-Footer-part-->
<script src="js/jquery.min.js"></script> 

<script>
function allsel(n1,n2)
{
  while(n1.selectedIndex!=-1)
  {
   var indx=n1.selectedIndex;
   var t=n1.options[indx].text;
   n2.options.add(new Option(t,t,true,true));
   n1.remove(indx);
  }
}

function check(){
	var select=document.getElementById("sel_place2");
	if(select.options.length<=0){
		alert("请先把要分配的人员移到右侧窗口再提交");
		return false;
	}
	/*提交之前选中右侧框中的所有选项*/
	for(var i=0;i<select.options.length;i++){
		select.options[i].selected=true;
	}
	return true;
}

</script>

</body>
</html>
